//package me.firstapp.service.weixin.kami.impl;
//
//import java.math.BigDecimal;
//import java.util.Date;
//import java.util.List;
//import java.util.Map;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import me.firstapp.common.utils.Page;
//import me.firstapp.common.utils.StrUtils;
//import me.firstapp.module.weixin.kami.KaMiCategory;
//import me.firstapp.module.weixin.kami.KaMiProduct;
//import me.firstapp.repository.weixin.KaMiCategoryRepository;
//import me.firstapp.repository.weixin.KaMiProductRepository;
//import me.firstapp.service.weixin.kami.KaMiProductService;
//
//@Service
//public class KaMiProductServiceImpl implements KaMiProductService {
//
//	@Autowired
//	private KaMiProductRepository kaMiProductRepository;
//
//	@Autowired
//	private KaMiCategoryRepository kaMiCategoryRepository;
//
//	@Override
//	public Page<KaMiProduct> findKaMiProductPage(Integer pageNo, Integer pageSize, Map<String, Object> searchParams,
//			String sortParam, String sortType) {
//		return kaMiProductRepository.findKaMiProductPage(pageNo, pageSize, searchParams, sortParam, sortType);
//	}
//
//	@Override
//	public KaMiProduct executeAddKaMiProduct(Long kaMiCategoryId, String name, BigDecimal cost, BigDecimal fansPrice,
//			BigDecimal baseVipPrice, BigDecimal highVipPrice, BigDecimal chiefBaseVipJinBi,
//			BigDecimal chiefHighVipJinBi, BigDecimal chiefBaseVipPoint, BigDecimal chiefHighVipPoint,
//			String description, String sendType, String remark, String channel, BigDecimal exchangePoint,
//			String orderRemarkTip) {
//		KaMiProduct kaMiProduct = new KaMiProduct();
//		kaMiProduct.setKaMiCategoryId(kaMiCategoryId);
//		kaMiProduct.setName(name);
//		KaMiCategory kaMiCategory = (KaMiCategory) kaMiCategoryRepository.getById(kaMiCategoryId);
//		kaMiProduct.setCategoryName(kaMiCategory.getName());
//		kaMiProduct.setCost(cost);
//		kaMiProduct.setFansPrice(fansPrice);
//		kaMiProduct.setBaseVipPrice(baseVipPrice);
//		kaMiProduct.setHighVipPrice(highVipPrice);
//		kaMiProduct.setChiefBaseVipJinBi(chiefBaseVipJinBi);
//		kaMiProduct.setChiefHighVipJinBi(chiefHighVipJinBi);
//		kaMiProduct.setChiefBaseVipPoint(chiefBaseVipPoint);
//		kaMiProduct.setChiefHighVipPoint(chiefHighVipPoint);
//		kaMiProduct.setDescription(description);
//		kaMiProduct.setSendType(sendType);
//		kaMiProduct.setRemark(remark);
//		kaMiProduct.setStatus(KaMiProduct.STATUS_OFF);
//		kaMiProduct.setTimeAt(new Date());
//		kaMiProduct.setChannel(channel);
//		kaMiProduct.setExchangePoint(exchangePoint);
//		kaMiProduct.setOrderRemarkTip(orderRemarkTip);
//		kaMiProductRepository.save(kaMiProduct);
//		return kaMiProduct;
//	}
//
//	@Override
//	public KaMiProduct executeUpdateKaMiProduct(Long id, Long kaMiCategoryId, String name, BigDecimal cost,
//			BigDecimal fansPrice, BigDecimal baseVipPrice, BigDecimal highVipPrice, BigDecimal chiefBaseVipJinBi,
//			BigDecimal chiefHighVipJinBi, BigDecimal chiefBaseVipPoint, BigDecimal chiefHighVipPoint,
//			String description, String sendType, String remark, Integer status, String channel,
//			BigDecimal exchangePoint, String orderRemarkTip) {
//		KaMiProduct kaMiProduct = (KaMiProduct) kaMiProductRepository.getById(id);
//		if (null != kaMiCategoryId) {
//			kaMiProduct.setKaMiCategoryId(kaMiCategoryId);
//			KaMiCategory kaMiCategory = (KaMiCategory) kaMiCategoryRepository.getById(kaMiCategoryId);
//			kaMiProduct.setCategoryName(kaMiCategory.getName());
//		}
//		if (null != status) {
//			kaMiProduct.setStatus(status);
//		}
//		if (StrUtils.isNotNULL(name)) {
//			kaMiProduct.setName(name);
//		}
//		if (null != cost) {
//			kaMiProduct.setCost(cost);
//		}
//		if (null != fansPrice) {
//			kaMiProduct.setFansPrice(fansPrice);
//		}
//		if (null != baseVipPrice) {
//			kaMiProduct.setBaseVipPrice(baseVipPrice);
//		}
//		if (null != highVipPrice) {
//			kaMiProduct.setHighVipPrice(highVipPrice);
//		}
//		if (null != chiefBaseVipJinBi) {
//			kaMiProduct.setChiefBaseVipJinBi(chiefBaseVipJinBi);
//		}
//		if (null != chiefHighVipJinBi) {
//			kaMiProduct.setChiefHighVipJinBi(chiefHighVipJinBi);
//		}
//		if (null != chiefBaseVipPoint) {
//			kaMiProduct.setChiefBaseVipPoint(chiefBaseVipPoint);
//		}
//		if (null != chiefHighVipPoint) {
//			kaMiProduct.setChiefHighVipPoint(chiefHighVipPoint);
//		}
//		if (StrUtils.isNotNULL(description)) {
//			kaMiProduct.setDescription(description);
//		}
//		if (StrUtils.isNotNULL(sendType)) {
//			kaMiProduct.setSendType(sendType);
//		}
//		if (StrUtils.isNotNULL(remark)) {
//			kaMiProduct.setRemark(remark);
//		}
//		if (StrUtils.isNotNULL(channel)) {
//			kaMiProduct.setChannel(channel);
//		}
//		if (null != exchangePoint) {
//			kaMiProduct.setExchangePoint(exchangePoint);
//		}
//		if (StrUtils.isNotNULL(orderRemarkTip)) {
//			kaMiProduct.setOrderRemarkTip(orderRemarkTip);
//		}
//		return kaMiProduct;
//	}
//
//	@Override
//	public KaMiProduct findById(Long id) {
//		return (KaMiProduct) kaMiProductRepository.getById(id);
//	}
//
//	@Override
//	public List<KaMiProduct> findKaMiProductListByCategory(Long kaMiCategoryId, String channel) {
//		return kaMiProductRepository.findKaMiProductListByCategory(kaMiCategoryId, channel);
//	}
//
//	@Override
//	public List<KaMiProduct> findExchangeKaMiProductList() {
//		return kaMiProductRepository.findExchangeKaMiProductList();
//	}
//
//}
